3.1.10 \(\int \frac {\sin (x)}{4-5 \cos (x)+\cos ^2(x)} \, dx\) [10]

Optimal. Leaf size=23 \[ \frac {1}{3} \log (1-\cos (x))-\frac {1}{3} \log (4-\cos (x)) \]

[Out]

1/3*ln(1-cos(x))-1/3*ln(4-cos(x))

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {3340, 630, 31} \begin {gather*} \frac {1}{3} \log (1-\cos (x))-\frac {1}{3} \log (4-\cos (x)) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sin[x]/(4 - 5*Cos[x] + Cos[x]^2),x]

[Out]

Log[1 - Cos[x]]/3 - Log[4 - Cos[x]]/3

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rule 630

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Dist[c/q, Int[1/Simp
[b/2 - q/2 + c*x, x], x], x] - Dist[c/q, Int[1/Simp[b/2 + q/2 + c*x, x], x], x]] /; FreeQ[{a, b, c}, x] && NeQ
[b^2 - 4*a*c, 0] && PosQ[b^2 - 4*a*c] && PerfectSquareQ[b^2 - 4*a*c]

Rule 3340

Int[((a_.) + (b_.)*(cos[(d_.) + (e_.)*(x_)]*(f_.))^(n_.) + (c_.)*(cos[(d_.) + (e_.)*(x_)]*(f_.))^(n2_.))^(p_.)
*sin[(d_.) + (e_.)*(x_)]^(m_.), x_Symbol] :> Module[{g = FreeFactors[Cos[d + e*x], x]}, Dist[-g/e, Subst[Int[(
1 - g^2*x^2)^((m - 1)/2)*(a + b*(f*g*x)^n + c*(f*g*x)^(2*n))^p, x], x, Cos[d + e*x]/g], x]] /; FreeQ[{a, b, c,
 d, e, f, n, p}, x] && EqQ[n2, 2*n] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\sin (x)}{4-5 \cos (x)+\cos ^2(x)} \, dx &=-\text {Subst}\left (\int \frac {1}{4-5 x+x^2} \, dx,x,\cos (x)\right )\\ &=-\left (\frac {1}{3} \text {Subst}\left (\int \frac {1}{-4+x} \, dx,x,\cos (x)\right )\right )+\frac {1}{3} \text {Subst}\left (\int \frac {1}{-1+x} \, dx,x,\cos (x)\right )\\ &=\frac {1}{3} \log (1-\cos (x))-\frac {1}{3} \log (4-\cos (x))\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 29, normalized size = 1.26 \begin {gather*} \frac {2}{3} \log \left (\sin \left (\frac {x}{2}\right )\right )-\frac {1}{3} \log \left (3+2 \sin ^2\left (\frac {x}{2}\right )\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sin[x]/(4 - 5*Cos[x] + Cos[x]^2),x]

[Out]

(2*Log[Sin[x/2]])/3 - Log[3 + 2*Sin[x/2]^2]/3

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 16, normalized size = 0.70

method result size
derivativedivides \(\frac {\ln \left (-1+\cos \left (x \right )\right )}{3}-\frac {\ln \left (\cos \left (x \right )-4\right )}{3}\) \(16\)
default \(\frac {\ln \left (-1+\cos \left (x \right )\right )}{3}-\frac {\ln \left (\cos \left (x \right )-4\right )}{3}\) \(16\)
norman \(\frac {2 \ln \left (\tan \left (\frac {x}{2}\right )\right )}{3}-\frac {\ln \left (5 \left (\tan ^{2}\left (\frac {x}{2}\right )\right )+3\right )}{3}\) \(22\)
risch \(\frac {2 \ln \left ({\mathrm e}^{i x}-1\right )}{3}-\frac {\ln \left ({\mathrm e}^{2 i x}-8 \,{\mathrm e}^{i x}+1\right )}{3}\) \(29\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(4-5*cos(x)+cos(x)^2),x,method=_RETURNVERBOSE)

[Out]

1/3*ln(-1+cos(x))-1/3*ln(cos(x)-4)

________________________________________________________________________________________

Maxima [A]
time = 0.27, size = 15, normalized size = 0.65 \begin {gather*} \frac {1}{3} \, \log \left (\cos \left (x\right ) - 1\right ) - \frac {1}{3} \, \log \left (\cos \left (x\right ) - 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)^2),x, algorithm="maxima")

[Out]

1/3*log(cos(x) - 1) - 1/3*log(cos(x) - 4)

________________________________________________________________________________________

Fricas [A]
time = 0.37, size = 19, normalized size = 0.83 \begin {gather*} \frac {1}{3} \, \log \left (-\frac {1}{2} \, \cos \left (x\right ) + \frac {1}{2}\right ) - \frac {1}{3} \, \log \left (-\cos \left (x\right ) + 4\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)^2),x, algorithm="fricas")

[Out]

1/3*log(-1/2*cos(x) + 1/2) - 1/3*log(-cos(x) + 4)

________________________________________________________________________________________

Sympy [A]
time = 0.07, size = 15, normalized size = 0.65 \begin {gather*} - \frac {\log {\left (\cos {\left (x \right )} - 4 \right )}}{3} + \frac {\log {\left (\cos {\left (x \right )} - 1 \right )}}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)**2),x)

[Out]

-log(cos(x) - 4)/3 + log(cos(x) - 1)/3

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 19, normalized size = 0.83 \begin {gather*} -\frac {1}{3} \, \log \left (-\cos \left (x\right ) + 4\right ) + \frac {1}{3} \, \log \left (-\cos \left (x\right ) + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sin(x)/(4-5*cos(x)+cos(x)^2),x, algorithm="giac")

[Out]

-1/3*log(-cos(x) + 4) + 1/3*log(-cos(x) + 1)

________________________________________________________________________________________

Mupad [B]
time = 0.10, size = 9, normalized size = 0.39 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {2\,\cos \left (x\right )}{3}-\frac {5}{3}\right )}{3} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sin(x)/(cos(x)^2 - 5*cos(x) + 4),x)

[Out]

(2*atanh((2*cos(x))/3 - 5/3))/3

________________________________________________________________________________________